<template>
  <div id="userInfo">
    <el-avatar
      src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
    ></el-avatar>
    <el-dropdown @command="handleCommand">
      <span class="el-dropdown-link">
        老胡来也<i class="el-icon-arrow-down el-icon--right"></i>
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item command="/usercenter/notice">消息通知</el-dropdown-item>
        <el-dropdown-item command="/usercenter/center">个人设置</el-dropdown-item>
        <el-dropdown-item command="/logout">退出登录</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</template>
<script>
export default {
  methods:{
    handleCommand:function(arg){
      console.log(arg);
      this.$router.push(arg)
    }
  }
}
</script>
<style scoped>
#userInfo {
  display: flex;
  justify-content: right;
  align-items: center;
}
</style>